<?php
class ControllerAccountPassreset extends Controller {
	
		public function index() {
             //if ($this->customer->isLogged()) {
		//	$this->redirect($this->url->https('account/forgotten'));
		//}

		//$this->language->load('account/forgotten');

		//$this->document->title = $this->language->get('heading_title');

		$this->load->model('account/customer');
              $this->load->model('account/passreset');
//echo $_REQUEST['user'];
                $passreset_info=$this->model_account_passreset->getActivecodeByUsername($_REQUEST['user']);
//echo md5('af2e5c6');
		if(strcmp( $passreset_info['activecode'],$_REQUEST['codeActive'])==0){
                
                $this->model_account_customer->editPassword($_REQUEST['user'],  $passreset_info['passrequest'] );
                 $this->model_account_passreset->changeActiveByUsername($_REQUEST['user']);            
                }

		$this->id       = 'content';
		$this->template = $this->config->get('config_template') . 'account/passreset.phtml';

		$this->layout   = 'common/layout';

		$this->render();
	}
}
?>